package com.superbytecode.cloud.rocketmq.consumer;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: beacon-cloud
 * @Package: com.superbytecode.cloud.rocketmq.annotation
 * @ClassName: Consumer
 * @Description: [消费者注解]
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/11/1 15:19
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Component
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Consumer {
    /**
     * 消费者组名，默认服务名称
     */
    String group() default "${spring.application.name}";

    /**
     * topic标签
     */
    String tag() default "*";

    /**
     * 消费模式: 顺序消费、并发消费和异步阻塞消费
     */
    ConsumeMode consumeMode() default ConsumeMode.CONCURRENTLY;

    /**
     * 消息模式: 集群模式（默认值），广播模式
     */
    MessageModel messageModel() default MessageModel.CLUSTERING;

}
